<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3_数据类型</title>
</head>
<body>

<script>
    // JS 数据类型=原始类型+引用数据类型
    // 原始数据类型 : number,string,boolean,undefined,null
    var a=1;
    var b=2;
    console.log(a,typeof a,b ,typeof b)
    var c='数据';
    var d="你好";
    console.log(c,typeof c,d,typeof d);
    var e=true;
    var f=false;
    console.log(e,typeof e,f,typeof f);
    // 声明了变量但是赋值,就会得到undefined 未定义类型
    var g;
    console.log(g,typeof g);
    // 引用数据类型：object Number,String,Boolean,Array,Object,Function,Date,RegExp,Math,JSON
    //1) 自定义对象
    let  obj = {
        name:"yigei",
        age:18
    };
    console.log(obj,typeof obj);//{name:"yigei",age:18}
    console.log(obj.name);//yigei
    console.log(obj.age);//18
    // 可以后期动态的给对象新增加一个属性
    obj.leke="哈哈哈";
    console.log(obj);
    console.log(obj.leke);
    console.log(obj.play);//undefined
    // JS 数组
    let arr=['1',2,3.9,true,5];
    console.log(arr,typeof arr);
    console.log(arr[0]);
    console.log(arr[3]);
    console.log(arr[90]);//undefined



</script>
</body>
</html>